/*
 * CategoryActiveItem.java
 * business
 *
 * Created by SunDing on 2016/12/3.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.yidiandao.business.data.imagemodule.ImageAD;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.CategoryActiveHolder;
import com.yidiandao.business.utils.ImageLoader;
import com.yidiandao.business.utils.JumpUtils;

/** 分类的活动item */
public class CategoryActiveListItem extends DisplayListItem<CategoryActiveHolder, ImageAD> {

    public CategoryActiveListItem(ImageAD bean) {
        super(bean);
    }

    @Override
    public void onShow(final Context context, CategoryActiveHolder holder) {
        ImageLoader.loadActiveImageFitXY(context, holder.mIcActive, data.getImage());
        holder.mIcActive.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        JumpUtils.clickImageAD((Activity) context, data);
                    }
                });
    }

    @Override
    public String getDisplayItemTag() {
        return CategoryActiveListItem.class.getSimpleName();
    }

    @Override
    public Class<CategoryActiveHolder> getViewHolderClazz() {
        return CategoryActiveHolder.class;
    }
}
